﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace SchoolRoles
{
    public partial class Admin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ListBoxUsers.DataSource = Membership.GetAllUsers();
                ListBoxUsers.DataBind();
            }
            
        }

        protected void ButtonDeleteUser_Click(object sender, EventArgs e)
        {
            if (ListBoxUsers.SelectedItem != null)
            {
                Membership.DeleteUser(ListBoxUsers.SelectedValue);
                ListBoxUsers.DataSource = Membership.GetAllUsers();
                ListBoxUsers.DataBind();
            }
        }

    }
}